import {NgModule, Optional, SkipSelf, ModuleWithProviders} from '@angular/core';
import {NgZorroAntdModule} from 'ng-zorro-antd';
import {throwIfAlreadyLoaded} from '@core/module-import-guard';

@NgModule({
  imports: [
    NgZorroAntdModule.forRoot()
  ]
})
export class UiModule {
  constructor(
    @Optional()
    @SkipSelf()
      parentModule: UiModule,
  ) {
    throwIfAlreadyLoaded(parentModule, 'UiModule');
  }

  static forRoot(): ModuleWithProviders {
    return {
      ngModule: UiModule,
      providers: []
    };
  }
}
